package com.sc.nft.entity.vo;

import cn.hutool.core.util.ObjectUtil;
import com.sc.nft.enums.PrizeDrawActivityTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class ParticipationDataVO {

    @ApiModelProperty(value = "参与人数")
    private Long attendUserCount;

    @ApiModelProperty(value = "参与次数")
    private Long attendCount;

    @ApiModelProperty(value = "已发放奖券")
    private Long equityCount;

    @ApiModelProperty(value = "已使用奖券")
    private Long useEquityCount;

    @ApiModelProperty(value = "本期累计金额")
    private String accumulatedAmount = "0";

    @ApiModelProperty(value = "本期预留金额")
    private String reserveAmount = "0";

    @ApiModelProperty(value = "本期发放金额")
    private String disbursementAmount = "0";

    @ApiModelProperty(value = "本期未发放金额")
    private String unissuedAmount = "0";

    @ApiModelProperty(value = "本期剩余总金额")
    private String residualAmount = "0";

    public void setAccumulatedAmount(BigDecimal accumulatedAmount) {
        this.accumulatedAmount = accumulatedAmount.stripTrailingZeros().toPlainString();
    }

    public void setReserveAmount(BigDecimal reserveAmount) {
        this.reserveAmount = reserveAmount.stripTrailingZeros().toPlainString();
    }

    public void setDisbursementAmount(BigDecimal disbursementAmount) {
        this.disbursementAmount = disbursementAmount.stripTrailingZeros().toPlainString();
    }

    public void setUnissuedAmount(BigDecimal unissuedAmount) {
        this.unissuedAmount = unissuedAmount.stripTrailingZeros().toPlainString();
    }

    public void setResidualAmount(BigDecimal residualAmount) {
        this.residualAmount = residualAmount.stripTrailingZeros().toPlainString();
    }

    public void setAttendUserCount(Long attendUserCount) {
        this.attendUserCount = ObjectUtil.isNull(attendUserCount)? 0L:attendUserCount;
    }

    public void setAttendCount(Long attendCount) {
        this.attendCount = ObjectUtil.isNull(attendCount)? 0L:attendCount;
    }

    public void setEquityCount(Long equityCount) {
        this.equityCount = ObjectUtil.isNull(equityCount)? 0L:equityCount;
    }

    public void setUseEquityCount(Long useEquityCount) {
        this.useEquityCount = ObjectUtil.isNull(useEquityCount)? 0L:useEquityCount;
    }
}
